<?php 
defined('IN_TS') or die('Access Denied.'); 

function newtask(){
	global $db;
	//最新任务
	if( $GLOBALS['TS_USER']!=''){
		$mylink = '&link='.$GLOBALS['TS_USER']['userid'];
	}
	$arrTasks = aac('task')->findAll('task',
		'isaudit=0 and limittime>'.time()
	,'addtime desc','',5);
	
	foreach($arrTasks as $key=>$item){

		    $arrTask[] = $item;
			$arrTask[$key]['title']=tsTitle($item['title']);
			$arrTask[$key]['user'] = aac('user')->getOneUser($item['userid']);
			$arrTask[$key]['type'] = aac('task')->getType($item['typeid']);

		   }

	include template('newtask','newtask');
	
}

function newtask_css(){

	echo '<link href="'.SITE_URL.'plugins/home/newtask/style.css" rel="stylesheet" type="text/css" />';

}

addAction('home_index_left','newtask');
addAction('pub_header_top','newtask_css');